﻿using CountryDepth.Library.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CountryDepth.Library.BusinessLogic
{
    public class BLUser
    {

        #region Public Properties

        public int UserId { get; set; }
        public string FullName { get; set; }

        public string UserName { get; set; }
        public string Password { get; set; }

        public string Telephone { get; set; }
        public string Mobile { get; set; }
        public string Email { get; set; }
        public string Address { get; set; }

        public int InitialAnnualBalance { get; set; }
        public int InitialCasualBalance { get; set; }

        public Item Manager { get; set; }

        public int WorkingHoursPerDay { get; set; }

        public bool IsFriWork { get; set; }
        public bool IsSatWork { get; set; }
        public bool IsSunWork { get; set; }
        public bool IsMonWork { get; set; }
        public bool IsTueWork { get; set; }
        public bool IsWedWork { get; set; }
        public bool IsThuWork { get; set; }

        #endregion

        #region Constructors

        public BLUser(int userId)
        {
            BLUser tempUser = Main.GetUserById(userId);

            this.UserId = tempUser.UserId;
            this.FullName = tempUser.FullName;

            this.Manager = tempUser.Manager;

            this.UserName = tempUser.UserName;
            this.Password = tempUser.Password;

            this.Telephone = tempUser.Telephone;
            this.Mobile = tempUser.Mobile;
            this.Email = tempUser.Email;
            this.Address = tempUser.Address;

            this.InitialAnnualBalance = tempUser.InitialAnnualBalance;
            this.InitialCasualBalance = tempUser.InitialCasualBalance;
            this.WorkingHoursPerDay = tempUser.WorkingHoursPerDay;

            this.IsFriWork = tempUser.IsFriWork;
            this.IsSatWork = tempUser.IsSatWork;
            this.IsSunWork = tempUser.IsSunWork;
            this.IsMonWork = tempUser.IsMonWork;
            this.IsTueWork = tempUser.IsTueWork;
            this.IsWedWork = tempUser.IsWedWork;
            this.IsThuWork = tempUser.IsThuWork;

        }

        public BLUser()
        {

        }

        #endregion

        #region Private Methods


        #endregion

        #region Public Methods

        public bool Save()
        {
            return Main.SaveUser(this);
        }

        public List<Item> GetAllUsers()
        {
            return Main.GetAllUsers();
        }
        #endregion

    }
}
